package com.qfedu.service.impl;

import com.qfedu.mapper.Sys_logMapper;
import com.qfedu.model.Project;
import com.qfedu.model.Sys_log;
import com.qfedu.page.PageResult;
import com.qfedu.page.QueryPageBean;
import com.qfedu.service.Sys_logService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @author LiJH
 * @date 2023-02-10
 */
public class Sys_logServiceImpl implements Sys_logService {
    @Autowired
    private Sys_logMapper sys_logMapper;
    @Override
    public PageResult findPage(QueryPageBean queryPageBean) {

        PageResult pageResult = new PageResult();
        Integer currentPage = queryPageBean.getCurrentPage();
        Integer pageSize = queryPageBean.getPageSize();
        long count = sys_logMapper.count();
        pageResult.setTotal(count);
        List<Project> page = sys_logMapper.findPage((currentPage - 1) * pageSize, pageSize);
        pageResult.setRows(page);
        return pageResult;
    }
}